package com.yzp.api.controller;

import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Date;

/**
 * Description
 *
 * @className: UserController
 * @author: yanzhouping
 * @date: 2019/9/21 10:23
 */
@RestController
@RequestMapping("/userManagement")
public class UserController {

    @Value("${server.port}")
    private String serverPort;

    @RequestMapping("/getInfo")
    public String getInfo(){
        return "我是用户微服务端口号:"+serverPort;
    }
    @RequestMapping("/getDate")
    public Date getDate(){
        return new Date();
    }

    @ApiOperation(value = "获取用户", notes = "获取一个用户", produces = "application/json")
    @ApiParam(name = "name",required = true,value = "用户姓名",type = "String")
    @GetMapping("/order")
    public String getUser( String name) {
        return name;
    }
}
